import { POST } from '../axios.config.js'

const base = window.config.ip
const supTask = `${base}/xn-supervise/sup-task`
const organ = `${base}/public-uias-api/uias-organ`

const URLS = {
  listProvince: `${base}/bbcs/code-public/skipValidation/listProvince`,

  // 单位
  listCollectOrgan: `${supTask}/listCollectOrgan`, // 获取全部单位
  listJxOrgByPid: `${organ}/listJxOrgByPid`, // 获取单位的二级机构
  listCityWindow: `${organ}/skipValidation/listCityWindow`, // 获取市县窗口机构
  listCheckOrgan: `${base}/public-uias-api/uias-organ/listCheckOrgan`, // 效能推送 - 获取单位分类和单位列表
}

// 获取省级地区列表
export const listProvince = () => POST(URLS.listProvince)

// 获取全部的省直单位列表
export const listAllOrgs = () => POST(URLS.listCollectOrgan)

// 获取全部的省直单位列表
export const listChildOrgs = id => POST(URLS.listJxOrgByPid, { oneParam: id })

// 获取市县窗口机构
export const listCityWindow = id => POST(URLS.listCityWindow)

// 效能监测 - 获取单位分类和单位列表
export const listCheckOrgan = () => POST(URLS.listCheckOrgan)
